<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button class="btn">登录</button>
    <input type="text" />
    <script>
      // 表单中属性设置
      //1. 获取元素
      var btn = document.querySelector('.btn');
      var inp = document.querySelector('input');
      //2.事件类型
      btn.onclick = function () {
        // 3事件代码
        btn.disabled = true;
        inp.value = '登录按钮静止';
      };
    </script>
  </body>
</html>
